<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/10/010
 * Time: 16:46
 */

namespace app\validate;


use think\Validate;

class MenuValidate extends Validate
{
    protected $rule = [
        'name'=>'require',
        'project'=>'require',
        'c'=>'require',
        'a'=>'require',
        'parent_id'=>'require|number',
        'sort'=>'require|number',
        'show_menu'=>'in:0,1',
        'status'=>'in:0,1',
    ];

    protected $message =[
        'name.require'=>'菜单名字必须',
        'project.require'=>'项目必须',
        'c.require'=>'控制器必须',
        'a.require'=>'方法必须',
        'parent_id.require'=>'父级菜单必须',
        'parent_id.number'=>'父级菜单格式错误',
        'sort.require'=>'排序必须',
        'sort.number'=>'排序错误',
        'show_menu.in'=>'菜单显示状态错误',
        'status.in'=>'菜单状态错误',
    ];
}